<!DOCTYPE html>
{% load common_extras %}
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div class="left">
    {% if username %}
        <a href="{% url 'index' %}">首页</a>
    {% else %}
        <a href="#">首页</a>
    {% endif %}
</div>
<div class="right">
    {% if username %}
        {{ username|default:'登录'|mycapfirst }} | {% current_time '%Y-%m-%d %H:%M:%S' %}
        &emsp;&emsp;
        <a href="{% url 'logout' %}" class="func">退出登录</a>
        <a href="{% url 'AddArticle' %}" class="func">发布</a>
     {% else %}
        &emsp;&emsp;
        <a href="{% url 'login' %}" class="func">立即登录</a>
    {% endif %}
</div>
</body>
</html>